package com.example.demo2.common.exceptions;

import java.util.concurrent.atomic.AtomicLong;

public abstract class BaseException extends RuntimeException {

    private static final long serialVersionUID = 1L;
    static AtomicLong atomicLong = new AtomicLong(System.currentTimeMillis());
    String id;

    public BaseException() {
        setId();
    }

    public BaseException(String message) {
        super(message);
        setId();
    }

    public BaseException(String message, Throwable cause) {
        super(message, cause);
        setId();
    }

    void setId() {
        long nid = atomicLong.incrementAndGet();
        id = Long.toString(nid, 26);
    }

    public abstract String getErrorTitle();

    public abstract String getErrorDescription();

    public Integer getLineNumber() {
        return -1;
    }

    public String getSourceFile() {
        return "";
    }

    public String getId() {
        return id;
    }

    public String getMoreHTML() {
        return null;
    }
}